package com.k2091.washcar.service.impl;

import com.k2091.washcar.entity.FormInline;
import com.k2091.washcar.entity.ServiceItem;
import com.k2091.washcar.mapper.ServiceItemMapper;
import com.k2091.washcar.service.IServiceItemService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author author
 * @since 2021-06-01
 */
@Service
public class ServiceItemServiceImpl extends ServiceImpl<ServiceItemMapper, ServiceItem> implements IServiceItemService {

    @Autowired
    private ServiceItemMapper serviceItemMapper;

    @Override
    public List<ServiceItem> selectProject(FormInline formInline) {
        return serviceItemMapper.selectService(formInline);
    }

    @Override
    public boolean ServiceDelete(Long id) {
        return serviceItemMapper.deleteById(id);
    }

    @Override
    public void upStatus(Long id, int status) {
        serviceItemMapper.upStatus(id, status);
    }

    @Override
    public int upProject(ServiceItem serviceItem) {
        return serviceItemMapper.updateById(serviceItem);
    }

    @Override
    public void addService(ServiceItem serviceItem) {
        serviceItemMapper.insert(serviceItem);
    }

    @Override
    public ServiceItem selectServiceById(Long id) {
        return serviceItemMapper.selectServiceById(id);
    }
}
